<!-- 

This is the owner front page which is directed to after login. 

Author: Ludvig Gee.

 -->

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="Style.css">
<title>Hungry In Lindholmen - Find where you can eat what you want to eat</title>

</head>

<!-- 

Creates a popup which tells the user whether their manipulation
of the database was successful depending on which parameter is received. 

-->

<script TYPE="text/javascript">
<% if(request.getAttribute("delDone") != null){ %>
function myFunction()
{
	alert("Deletion successful!");
}<%}%>

<% if(request.getAttribute("addDone") != null){ %>
function myFunction()
{
	alert("Added new entry!");
}<%}%>

<% if(request.getAttribute("editDone") != null){ %>
function myFunction()
{
	alert("Updated!");
}<%}%>
</script>

<!-- 

Creates a popup showing the chart image from the chartServlet. 

-->

	<SCRIPT TYPE="text/javascript">

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=1610,height=730,scrollbars=yes,left=100,top=100,toolbar=yes,rezisable=yes');
return false;
}

</SCRIPT>

</head>
<body onload="myFunction()">


<div id="container">

	
	<div id="header">
		<img src="header3.png">
		<div id="owner">
			<a id="owner" href="Logout">Logout</a>
		</div>
	</div>
	
<!-- 

The submit form with radio buttons to send parameter to OwnerServlet.

-->
	
	<form class="form-wrapper" method="post" action="OwnerServlet">
			<input type="radio" name="radioButton" value="a" checked>
		<b>a La Carte Menu</b>
		<input type="radio" name="radioButton" value="b" >
		<b>User/Pass</b>
		<input type="radio" name="radioButton" value="c" >
		<b>Lunch Menu</b>
		<input type="radio" name="radioButton" value="d" >
		<b>Restaurant Info</b>
		<input type="radio" name="radioButton" value="e" >
		<b>Opening Hours</b>
			<INPUT TYPE="submit" VALUE="Show table"> 
	</form>
<!-- 

Links to initiate javascript to show chart.

-->
	  <div id="restaurantlist">
	  	<b>Statistics</b>
		<ul>
			<li><A HREF="ChartServlet?type=a&restId=<%=request.getSession().getAttribute("restID") %>" onClick="return popup(this, 'chart')">Top 10 Dishes</A>
			<li><A HREF="ChartServlet?type=b&restId=<%=request.getSession().getAttribute("restID") %>" onClick="return popup(this, 'chart')">Top 10 Searches</A>
			<li><A HREF="ChartServlet?type=c&restId=<%=request.getSession().getAttribute("restID") %>" onClick="return popup(this, 'chart')">Top 10 Restaurants</A>		
			<li><A HREF="ChartServlet?type=d&restId=<%=request.getSession().getAttribute("restID") %>" onClick="return popup(this, 'chart')">Top 10 Lunch Dishes</A>
		</ul>
	</div>
  <div id="firstpage">
  Please select in the above menu which option you would like to edit and then click "Show table"
  
</div>
	<div id="footer">
		Hungry In Lindholmen created by Group 6 Saturn<br>
		For more information, questions or whatever send us an 
		<a href="mailto:olof.ekelund84@gmail.com?subject=HungryInLindholmen"> e-mail.</a></div>

</div>
</body>
</html>